package net.cachapa.libra;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.webkit.WebView;
import android.webkit.WebViewClient;

public class TinyWebBrowser extends Activity {
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		setContentView(R.layout.tinywebbrowser);
		
		// Retrieving the url from the calling intent
		String url = getIntent().getExtras().getString("url");
		Log.d("webview", url);
		
		WebView wv = (WebView) findViewById(R.id.WebView);
		wv.setWebViewClient(new TinyWebBrowserClient());
		wv.getSettings().setJavaScriptEnabled(true);
		wv.loadUrl(url);
	}
	
	
	
	
	private class TinyWebBrowserClient extends WebViewClient {
	    @Override
	    public boolean shouldOverrideUrlLoading(WebView view, String url) {
	        view.loadUrl(url);
	        return true;
	    }
	}
	
	
	// Here we start the next activity, and then call finish()
    // so that our own will stop running and be removed from the
    // history stack.
//    Intent intent = new Intent();
//    intent.setClass(Forwarding.this, ForwardTarget.class);
//    startActivity(intent);
//    finish();
}
